﻿<phone:PhoneApplicationPage 
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
	xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="800"
	x:Class="MyUtility.MoveRectPage"
	FontFamily="{StaticResource PhoneFontFamilyNormal}"
	FontSize="{StaticResource PhoneFontSizeNormal}"
	Foreground="{StaticResource PhoneForegroundBrush}"
	Orientation="Portrait"
	shell:SystemTray.IsVisible="True" Loaded="PhoneApplicationPage_Loaded">
	<phone:PhoneApplicationPage.Resources>
		<Storyboard x:Name="MoveRectStoryboard" AutoReverse="True" RepeatBehavior="5x">
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Canvas.Left)" Storyboard.TargetName="rectangle">
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="300">
					<EasingDoubleKeyFrame.EasingFunction>
						<ElasticEase EasingMode="EaseIn"/>
					</EasingDoubleKeyFrame.EasingFunction>
				</EasingDoubleKeyFrame>
				<EasingDoubleKeyFrame KeyTime="0:0:2" Value="300"/>
				<EasingDoubleKeyFrame KeyTime="0:0:3" Value="75"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Canvas.Top)" Storyboard.TargetName="rectangle">
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="47">
					<EasingDoubleKeyFrame.EasingFunction>
						<ElasticEase EasingMode="EaseIn"/>
					</EasingDoubleKeyFrame.EasingFunction>
				</EasingDoubleKeyFrame>
				<EasingDoubleKeyFrame KeyTime="0:0:2" Value="600"/>
				<EasingDoubleKeyFrame KeyTime="0:0:3" Value="600"/>
				<EasingDoubleKeyFrame KeyTime="0:0:4" Value="47"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Canvas.Left)" Storyboard.TargetName="ellipse">
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="300">
					<EasingDoubleKeyFrame.EasingFunction>
						<ElasticEase EasingMode="EaseOut"/>
					</EasingDoubleKeyFrame.EasingFunction>
				</EasingDoubleKeyFrame>
				<EasingDoubleKeyFrame KeyTime="0:0:2" Value="300">
					<EasingDoubleKeyFrame.EasingFunction>
						<ElasticEase EasingMode="EaseOut"/>
					</EasingDoubleKeyFrame.EasingFunction>
				</EasingDoubleKeyFrame>
				<EasingDoubleKeyFrame KeyTime="0:0:3" Value="70">
					<EasingDoubleKeyFrame.EasingFunction>
						<ElasticEase EasingMode="EaseOut"/>
					</EasingDoubleKeyFrame.EasingFunction>
				</EasingDoubleKeyFrame>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Canvas.Top)" Storyboard.TargetName="ellipse">
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="174">
					<EasingDoubleKeyFrame.EasingFunction>
						<ElasticEase EasingMode="EaseOut"/>
					</EasingDoubleKeyFrame.EasingFunction>
				</EasingDoubleKeyFrame>
				<EasingDoubleKeyFrame KeyTime="0:0:2" Value="700">
					<EasingDoubleKeyFrame.EasingFunction>
						<ElasticEase EasingMode="EaseOut"/>
					</EasingDoubleKeyFrame.EasingFunction>
				</EasingDoubleKeyFrame>
				<EasingDoubleKeyFrame KeyTime="0:0:3" Value="700">
					<EasingDoubleKeyFrame.EasingFunction>
						<ElasticEase EasingMode="EaseOut"/>
					</EasingDoubleKeyFrame.EasingFunction>
				</EasingDoubleKeyFrame>
				<EasingDoubleKeyFrame KeyTime="0:0:4" Value="47">
					<EasingDoubleKeyFrame.EasingFunction>
						<CubicEase EasingMode="EaseOut"/>
					</EasingDoubleKeyFrame.EasingFunction>
				</EasingDoubleKeyFrame>
			</DoubleAnimationUsingKeyFrames>
			<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Storyboard.TargetName="rectangle">
				<EasingColorKeyFrame KeyTime="0:0:1" Value="#FF49FF00"/>
				<EasingColorKeyFrame KeyTime="0:0:2" Value="Red"/>
				<EasingColorKeyFrame KeyTime="0:0:3" Value="#FF5CFF00"/>
				<EasingColorKeyFrame KeyTime="0:0:4" Value="#FF9B00FF"/>
			</ColorAnimationUsingKeyFrames>
		</Storyboard>
		<Storyboard x:Name="MoveVideoStoryboard" RepeatBehavior="10x" AutoReverse="True">
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="wp7_wmv">
				<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="1"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="wp7_wmv">
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="1"/>
				<EasingDoubleKeyFrame KeyTime="0:0:2" Value="1.588"/>
				<EasingDoubleKeyFrame KeyTime="0:0:4" Value="1.588"/>
				<EasingDoubleKeyFrame KeyTime="0:0:5" Value="3.09"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="wp7_wmv">
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="1"/>
				<EasingDoubleKeyFrame KeyTime="0:0:2" Value="1.588"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="wp7_wmv">
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:2" Value="8.183"/>
				<EasingDoubleKeyFrame KeyTime="0:0:3" Value="13.591"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="wp7_wmv">
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:2" Value="-4.645"/>
				<EasingDoubleKeyFrame KeyTime="0:0:3" Value="-318.335"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.Rotation)" Storyboard.TargetName="wp7_wmv">
				<EasingDoubleKeyFrame KeyTime="0:0:3" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:4" Value="360"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.CenterOfRotationX)" Storyboard.TargetName="wp7_wmv">
				<EasingDoubleKeyFrame KeyTime="0:0:4" Value="0.5"/>
				<EasingDoubleKeyFrame KeyTime="0:0:5" Value="0"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationX)" Storyboard.TargetName="wp7_wmv">
				<EasingDoubleKeyFrame KeyTime="0:0:4" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:5" Value="0"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationZ)" Storyboard.TargetName="wp7_wmv">
				<EasingDoubleKeyFrame KeyTime="0:0:4" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:5" Value="0"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationY)" Storyboard.TargetName="wp7_wmv">
				<EasingDoubleKeyFrame KeyTime="0:0:4" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:5" Value="35"/>
			</DoubleAnimationUsingKeyFrames>
		</Storyboard>
	</phone:PhoneApplicationPage.Resources>
	<Canvas Background="White">
		<Rectangle x:Name="rectangle" 
			Canvas.Left="75"  
			Canvas.Top="47"
			Stroke="Black"
			Fill="Blue" 
			Width="100"
			Height="100"
			/>
		<Ellipse x:Name="ellipse" Fill="Blue" Height="100" Canvas.Left="75" Stroke="Black" Canvas.Top="174" Width="100"/>
		<MediaElement x:Name="wp7_wmv" Height="172" Source="/Videos/wp7.wmv" Stretch="Fill" Width="303" Canvas.Top="373" Canvas.Left="75" RenderTransformOrigin="0.5,0.5">
			<MediaElement.Projection>
				<PlaneProjection/>
			</MediaElement.Projection>
			<MediaElement.RenderTransform>
				<CompositeTransform/>
			</MediaElement.RenderTransform>
		</MediaElement>
	</Canvas>

	<!--LayoutRoot is the root grid where all page content is placed-->
</phone:PhoneApplicationPage>